package com.josework.springhelloworld.factorybean;

import com.josework.springhelloworld.model.User;
import org.springframework.beans.factory.FactoryBean;

public class UserBeanFactory implements FactoryBean<User> {
    @Override
    public User getObject() throws Exception {
        User user = new User();
        user.setUsername("admin");
        return user;
    }

    @Override
    public Class<?> getObjectType() {
        return User.class;
    }

    @Override
    public boolean isSingleton() {
        return FactoryBean.super.isSingleton();
    }
}
